import 'package:flutter/material.dart';

import '../screen/Sunset.dart';

class TrendingItem extends StatelessWidget {
  final Color bc1;
  final Color bc2;
  final String img;
  final String text;
  final String tip;
  const TrendingItem({
    super.key,
    required this.bc1,
    required this.bc2,
    required this.img,
    required this.text,
    required this.tip,
  });

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        // SunsetScreen
        Navigator.push(context, MaterialPageRoute(builder: (context) {
          return SunsetScreen(
            bc1: bc1,
            tip: tip,
            img: img,
            text: text,
          );
        }));
      },
      child: Container(
        width: 140,
        padding: const EdgeInsets.all(10),
        margin: const EdgeInsets.only(right: 10, top: 20, bottom: 30),
        decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(10),
            gradient: LinearGradient(colors: [
              bc1,
              bc2,
            ], begin: Alignment.topLeft, end: Alignment.bottomRight),
            boxShadow: [
              BoxShadow(
                  color: bc1.withOpacity(0.2),
                  offset: const Offset(0, 13),
                  blurRadius: 27)
            ]),
        height: 100,
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Image.asset(
              img,
              scale: 0.8,
            ),
            Text(
              text,
              style: const TextStyle(color: Colors.white, fontSize: 13),
            ),
            Text(
              tip,
              style: const TextStyle(color: Colors.white, fontSize: 8),
            ),
          ],
        ),
      ),
    );
  }
}
